This invention relates generally to application environments which include an application editing environment and an application execution environment, and more particularly relates to a method and system for integrating external functions, in a seamless manner, into such an application environment.
Graphical application environments are becoming increasingly popular. An application environment typically includes an editing environment, which is used to create and modify an application, and an execution environment, which is used to run the application created in the editing environment. Examples of graphical application environments include database application environments which are used to create and execute front-end applications for querying and/or updating a database, and forms application environments which are used to create and execute forms applications for inputting and outputting data.
To simplify the creation of the user interface of the application, application environments typically allow drag-and-drop selection of the various user interface components (sometimes referred to as xe2x80x9cobjectsxe2x80x9d), such as text fields, radio buttons and checkboxes. To implement functionality in the user interface, the application environment provides a formula command language. The application developer can write a formula with the formula command language and specify that when the application is running in the application execution environment, the formula be executed upon the occurrence of a certain event, such as when a particular field obtains focus, or loses focus. The formula command language typically has a relatively simple syntax, and frequently includes the ability to invoke functions which provide certain predefined functionality, such as, for example, a Logarithm function for calculating logarithms, or a StringCompare function for comparing two strings. Thus, the overall functionality provided by the command language is in part dependent upon the number and type of functions which can be invoked from a formula.
For example, a particular input field of an application may require a user to enter a valid date. The developer of the application can write a formula which will be executed when a user tabs out of (i.e., the cursor is moved from) the input field, and which determines whether the data entered by the user is a valid date. To determine if the data constitutes a valid date, the formula may invoke a date function which accepts a string in xe2x80x98mm/dd/yyxe2x80x99 format, and which returns true if the string contains a valid date, and false if it does not. If the user-entered data is not a valid date, the formula could display a message, sound a beep, and/or prevent the user from leaving the input field.
Even from the relatively simple example presented, it is apparent that the variety and power of the functions which can be invoked in a formula play an important role in the overall functionality that an application can provide. Most application environments provide a predetermined set of functions for use in their environment (referred to herein as xe2x80x9cnative functionsxe2x80x9d), and additional functions are provided only when new versions of the application environment are released. The inability to easily integrate add-on functions to an existing release inhibits the vendor of the application environment and third-party providers from providing functions which can exploit niche markets, or meet new demands required by rapidly changing environments.
Although some application environments do allow invocation of functions which are external to the application environment, the external functions must be invoked in a manner which is different from invoking native functions, and the developer must understand and be aware of these differences, increasing the difficulty of using external functions. While application environments provide online help for native functions, such as a list of function arguments, no such help is provided for external functions. In general, there is no effort to integrate the external functions into the application environment such that they appear, to an application developer, to be native functions.
For example, in the NOVELL(copyright) INFORMS(copyright) forms application environment, a developer can invoke external functions, but InForms provides no mechanism for integrating an external function into the application environment such that the developer can determine the names of available external functions, the functionality which is provided, or the parameters which the function requires. Thus, to use an external function, the developer must know the name of the external function library, the name of the function, and the parameters required by the function.
Another disadvantage of conventional application environments is their inability to verify that a formula which invokes an external function is syntactically correct. Because the external functions are not integrated into the application environment, any calls to the external functions cannot be checked to ensure that the correct number and correct types of parameters are being passed. If the function call is not syntactically correct, the external function will not be able to provide the desired functionality, resulting in the application working incorrectly, or possibly even terminating unexpectedly when the function is invoked. The inability to verify, during development, that the call to the external function is syntactically correct can decrease a developer""s desire to use external functions.
Yet another problem with the use of external functions in conventional application environments is that an external function can affect the value of a user interface object, such as a text field, only during the invocation of that function. That is, the data associated with a particular user interface object which are passed to a function can be changed by the function only during the invocation of the function, and once the function returns, the function can no longer affect the data. It would frequently be helpful if a developer could establish a continuous xe2x80x98bindingxe2x80x99 or xe2x80x98tiexe2x80x99 between a user interface object and a particular function, such that the data associated with an object in the user interface could be continually monitored by the function.
It is apparent that an application environment that can integrate external functions into the environment such that they are as easy for a developer to use as are native functions, which can perform syntax checking of external function calls, and which can bind a user interface object to an external function even after a call to the external function has returned would be highly desirable.
It is one object of this invention to provide a method and system for integrating external functions into an application environment.
It is another object of this invention to provide an application environment which can syntax check calls to external functions.
It is yet another object of this invention to provide an application environment which, upon request, displays the function signature of external functions which have been integrated into the application environment.
It is still another object of this invention to provide a method and system which simplify the development of external functions for use in an application environment.
It is still another object of this invention to provide an application environment which, upon request, can provide help information about external functions which have been integrated into the application environment.
It is yet another object of this invention to provide a method and system for binding a user interface object to an external function for a period of time greater than the function invocation call.
Additional objects, advantages and other novel features of the invention will be set forth in part in the description that follows and, in part, will become apparent to those skilled in the art upon examination of the invention.
To achieve the foregoing and other objects and in accordance with the purposes of the present invention as described above, a method and system are provided for integrating external functions into an application environment. The system includes a client module which has a predetermined interface and is operative to interact with one or more different external function modules which have the predetermined interface. The client module communicates with the external function module via the predetermined interface, and determines which external functions are provided by the external function module. The external function module communicates attributes of the functions, such as function prototypes of the available external functions, to the client module. The client module maintains the attributes in a symbol table for use in displaying function name and parameter information to a developer, and for syntax checking.
The client module is a component of an editing environment, and the editing environment is operative to communicate the attributes of the external functions in the symbol table, such as the function name, parameters and a brief description of the function, to a developer using the editing environment. From these displayed attributes, the developer can incorporate a call to an external function into a formula which is associated with a user interface component, or object, in the application being developed. Through the use of the function attributes in the symbol table, the editing environment can determine if the function invocation of the external function is syntactically correct. If the syntax of the function call is incorrect, for example, the wrong number or types of parameters are being passed to the external function, the editing environment can return a syntax error alerting the developer to the syntax problem.
According to one embodiment of this invention, the predetermined interface includes the external function module having a registration function which can be invoked by the client module. The client module passes an enumeration function to the registration function of the external function module. The external function module calls the enumeration function once for each external function offered by the external function module, and includes in the call function prototype information and short help information. The external function module also preferably has a help function which the client module can invoke upon request by a developer for help information regarding an external function. The help function can return information explaining the usage and providing examples of a particular external function offered by the external function module. The client module can display this information to a developer of the editing environment.
According to another embodiment of this invention, parameters to external functions can be defined as pass by asynchronous-access-mechanism (AAM). An AAM variable is used when an external function must have access to the variable even after the call to the external function has returned. An execution module of the application environment includes an Asynchronous Event Manager (AEM) which maintains AAM variables, and creates the binding between a particular user interface component, or object, and the respective external function. By binding the data in a user interface component to an AAM variable, the data can be continually updated without requiring interaction by the user.
The method and system according to this invention enable the integration of external functions into an application environment in a seamless manner such that the external functions appear to be native functions to the application environment. Thus, a vendor of an application environment can provide additional functions for use in the application environment without having to wait for a new release of the application environment. Third party developers can also enhance an application environment by providing packages of external functions to users of the application environment. New needs can be quickly met with new functions without having to wait for or rely upon the vendor of the application environment.